package app.form.component;

import java.util.List;

public class Button extends AbstractSelectComponent {
    private List<Float> items;
    public Button (String name, String title, List<Float> items) {
        super(name, title, items);
    }
    
    @Override
    public String renderCSS () {
        StringBuilder s = new StringBuilder ();
        s.append (".button_group {"
                    + "overflow: hidden;"
                    + "width: 290px;"
                + "}"
                + ".button_group button {"
                    + "width: 50px;"
                + "}");
        return s.toString();
    }

    @Override
    protected String getType() {
        return "button";
    }

    @Override
    protected String getItemHTML(Float value, int index) {
        return "<button onClick='JavaScript: getById(\"button_"+name+"_value\").innerHTML = this.innerHTML;'>" + value.toString() + "</button>";
    }

    @Override
    protected String getTitleHTML() {
        return "<div class='title'>" + title + "</div><span id='button_"+name+"_value'></span><br/>";
    }
    
    
}
